﻿package cn.ffcs.businessrequest.model;


import java.util.Date;

import cn.ffcs.base.model.BaseEntity;
import cn.ffcs.bpm.model.BizProcessManage;
import cn.ffcs.organ.model.Organization;
import cn.ffcs.organ.model.Person;
import cn.ffcs.system.dict.model.Dict;

/**
 * 产品改进需求单类：定义基本属性<br/>
 * <table>
 * <tr>
 * <td>负责人/principal:</td>
 * <td colspan="2">g.pany</td>
 * <tr>
 * <td>修改记录/revision:</td>
 * <td colspan="2"></td>
 * </tr>
 * <tr>
 * <td>日期:2010-1-8</td>
 * <td>修改人:g.pany</td>
 * <td>修改说明:</td>
 * </tr>
 * <tr>
 * <td></td>
 * <td></td>
 * <td></td>
 * </tr>
 * </table>
 * @author g.pany
 * @version $Id$
 */

public class ProdAdvReq extends ProdReq
{
    
    /** TODO 请输入字段日志 */
    private static final long serialVersionUID = -3509714198798356920L;

    /** 唯一键 **/
    private Integer id;
    
    /** 需求名称**/
    private String name;
    
    /** 需求类型**/
    private String reqClass;
    
    /** 关联单号，合并和分解的关联单号，多个可用逗号分开。与操作类型字段联合使用**/
    private String childAreq;
    
    /** 操作类型。是合并还是分解:HB;FJ**/
    private String opType;

    /** 分正常处理和拒绝处理.NEW:新增，WAIT:等待处理，REFUSE:拒绝，PENDING:待审核，PASS:审核通过，PROD:已提交处理。**/
    private String tranStatus;
    
    /** 正常处理和拒绝原因**/
    private String tranReason;

    /** 当前状态**/
    private String curStatus;

    /** 审核说明**/
    private String verifyExplain;
    
    private Integer procinstId;
    
    private String startUserName;
    
    /** 业务标签**/
    private String businessTag;
    
    public String getName()
    {
        return name;
    }

    public void setName(String name)
    {
        this.name = name;
    }
    
    public String getChildAreq()
    {
        return childAreq;
    }

    public void setChildAreq(String childAreq)
    {
        this.childAreq = childAreq;
    }

    public String getOpType()
    {
        return opType;
    }

    public void setOpType(String opType)
    {
        this.opType = opType;
    }

    public String getReqClass()
    {
        return reqClass;
    }

    public void setReqClass(String reqClass)
    {
        this.reqClass = reqClass;
    }

    public String getTranReason()
    {
        return tranReason;
    }

    public void setTranReason(String tranReason)
    {
        this.tranReason = tranReason;
    }

    public String getTranStatus()
    {
        return tranStatus;
    }

    public void setTranStatus(String tranStatus)
    {
        this.tranStatus = tranStatus;
    }

    public String getCurStatus()
    {
        if(tranStatus==null){
            return curStatus;
        }
        else if(tranStatus.equals("NEW")){
            return "新增";
        }
        else if(tranStatus.equals("WAIT")){
            return "待处理";
        }
        else if(tranStatus.equals("REFUSE")){
            return "拒绝";
        }
        else if(tranStatus.equals("PENDING")){
            return "待审核";
        }
        else if(tranStatus.equals("PASS")){
            return "审核通过";
        }
        else if(this.getRelaReq()!=null&&this.getRelaReq().getId()>0){
            return this.getRelaReq().getCurrStatus();
        }
        else if(tranStatus.equals("PROD")){
            return "已结束";
        }
        return curStatus;
    }

    public void setCurStatus(String curStatus)
    {
        this.curStatus = curStatus;
    }

    public Integer getId()
    {
        return id;
    }

    public void setId(Integer id)
    {
        this.id = id;
    }

    public void appendTranReason(String person,String action,String date,String tranReason)
    {
        if(this.tranReason!=null&&!this.tranReason.equals("")){
            this.tranReason+="<BR>";
        }
        if(tranReason!=null&&!"".equals(tranReason.trim())){
            this.tranReason+=date+" "+person+" "+action+"需求单 办理意见："+tranReason;
        }else{
            this.tranReason+=date+" "+person+" "+action+"需求单";
        }
    }

    public String getVerifyExplain()
    {
        return verifyExplain;
    }

    public void setVerifyExplain(String verifyExplain)
    {
        this.verifyExplain = verifyExplain;
    }

	public Integer getProcinstId() {
		return procinstId;
	}

	public void setProcinstId(Integer procinstId) {
		this.procinstId = procinstId;
	}

	public String getStartUserName() {
		return startUserName;
	}

	public void setStartUserName(String startUserName) {
		this.startUserName = startUserName;
	}

	public String getBusinessTag() {
		return businessTag;
	}

	public void setBusinessTag(String businessTag) {
		this.businessTag = businessTag;
	}
    
}
